
root_dir=`pwd`
mkdir build
cd build

echo -e "==========================build info=========================="
cmake -DENABLE_TESTING=Off ..
make
echo -e "========================== info end ==========================\n\n"


echo -e "============start memory check and interface test============="
cd $root_dir/build
valgrind --leak-check=full ./test/check_interface
echo -e "============ end memory check and interfacc test =============\n\n"


echo -e "================== start code static check ==================="
cd $root_dir
cppcheck ./src ./demos ./test
echo -e "==================== end code static check ===================\n\n"


echo -e "==========================start pack=========================="
cd $root_dir
rm -rf /tmp/upload /tmp/upload.tar.gz
mkdir /tmp/upload
mkdir /tmp/upload/lib
mkdir /tmp/upload/include
cp build/src/libsecurity.so /tmp/upload/lib
cp include/*.h /tmp/upload/include
cd /tmp/
tar -zcvf upload.tar.gz upload
echo -e "========================== pack end ==========================\n\n"